//
//  AFHTTPRequestOperationManager+RACSignalSupport.h
//  Vstore
//
//  Created by Eric Scott on 10/29/14.
//  Copyright (c) 2014 LITB. All rights reserved.
//

#import "AFHTTPRequestOperationManager.h"

@class RACSignal;

@interface AFHTTPRequestOperationManager (RACSignalSupport)

/**
 *  Creates and returns a signal that sends the HTTP GET request
 *
 *  @param URLString
 *  @param parameters parameters with request
 *
 *  @return return a signal with response
 */
- (RACSignal *)rac_signalForGET:(NSString *)URLString parameters:(NSDictionary *)parameters;

/**
 *  Creates and returns a signal that sends the HTTP POST request
 *
 *  @param URLString
 *  @param parameters parameters with request
 *
 *  @return a signal with response
 */
- (RACSignal *)rac_signalForPOST:(NSString *)URLString parameters:(NSDictionary *)parameters;
- (RACSignal *)rac_signalForPOSTWithoutJson:(NSString *)URLString parameters:(NSDictionary *)parameters;

/**
 *  Creates and returns a signal that sends the HTTP DELETE request
 *
 *  @param URLString
 *  @param parameters parameters with request
 *
 *  @return a signal with response
 */
- (RACSignal *)rac_signalForDELETE:(NSString *)URLString parameters:(NSDictionary *)parameters;

/**
 *  Creates and returns a signal that upload a file by using NSURL
 *
 *  @param URLString
 *  @param parameters parameters with request
 *  @param filePath
 *  @param name
 *  @param fileName
 *  @param mimeType
 *
 *  @return a signal with response(RACTuple first is AFHTTPRequestOperation, second is responseData)
 */
- (RACSignal *)rac_signalForPOST:(NSString *)URLString
                      parameters:(NSDictionary *)parameters
                        filePath:(NSURL *)filePath
                            name:(NSString *)name
                        fileName:(NSString *)fileName
                        mimeType:(NSString *)mimeType;

/**
 *  Creates and returns a signal that upload a file by using NSData
 *
 *  @param URLString
 *  @param parameters parameters with request
 *  @param fileData
 *  @param name
 *  @param fileName
 *  @param mimeType
 *
 *  @return a signal with response(RACTuple first is AFHTTPRequestOperation, second is responseData)
 */
- (RACSignal *)rac_signalForPOST:(NSString *)URLString
                      parameters:(NSDictionary *)parameters
                        fileData:(NSData *)fileData
                            name:(NSString *)name
                        fileName:(NSString *)fileName
                        mimeType:(NSString *)mimeType;

@end
